$(document).ready(function(){
	
	$("#btnLogin").click(function(e){
		e.preventDefault();
		url = "includes/login_control.php";
		data = $('#formLogin').serialize();
		$.post(url, data, function(data){
			if(data==1){data="Welcome!";}
			$('<div>'+data+'</div>').dialog({
		        resizable: false,
		        buttons: {
					"Ok": function() {
		                $(this).dialog("close");
		            	loadTemplate('includes/account_template.php', 'account', 0);
		            	connect('account');
		            }
				}
			});
		});
	});
});